package models

import (
	"gorm.io/gorm"
	"time"
)

// MODEL 自定义 gorm 默认生成字段
type MODEL struct {
	ID        uint           `gorm:"primaryKey" json:"id,select($any)"` // 主键id
	CreatedAt time.Time      `json:"created_at,select($any)"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

// RemoveRequest id 列表
type RemoveRequest struct {
	IdList []uint `json:"id_list"`
}

// EsIDRequest es文章id
type EsIDRequest struct {
	ID string `json:"id" uri:"id"`
}

// EsIDListRequest es文章列表id
type EsIDListRequest struct {
	IDList []string `json:"id_list" binding:"required"`
}

// PageInfo 分页
type PageInfo struct {
	Page  int    `form:"page"`
	Key   string `form:"key"` // 关键词搜索
	Limit int    `form:"limit"`
	Sort  string `form:"sort"` // 排序
}
